import time


from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select

driver = webdriver.Edge()
driver.get("http://127.0.0.1/ranzhi/www/")
time.sleep(1)

# 用户名密码
driver.find_element("xpath",'//*[@id="account"]').send_keys("admin")
driver.find_element("xpath",'//*[@id="password"]').send_keys("123456")
# 点击登录
driver.find_element("xpath",'//*[@id="submit"]').click()
time.sleep(1)

# 点击文档
driver.find_element('id','s-menu-4').click()

# 切换到iframe
driver.switch_to.frame(driver.find_element("id","iframe-4"))

# 点击其中一个文档库
driver.find_element('class name','libs-group-heading.libs-custom-heading').click()

# 点击创建文档
driver.find_element('class name','btn.btn-primary').click()

# 选择文件 大文件
a=driver.find_element('name','files[]')
a.send_keys('d:\\tools\\VMware-workstation-full-17.6.3-24583834.exe')
# 切换到提示框
alter1=driver.switch_to.alert
# 获取提示框的文本信息
print(alter1.text)
# 提示框的确认
alter1.accept()


driver.switch_to.default_content()

driver.find_element("class name","sign.signout").click()

time.sleep(20)
